home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / tifreadr.sit / Tiff Window DEMO / adjust scroll bars.c < prev    next >
C/C++ Source or Header  |  1990-01-31  |  993b  |  30 lines

  1. #include "my color.h"
  2.  
  3. void adjust_scroll_bars(whichWindow)    /* this routine is called from the "do mouse" routine.
  4.                                             Here I will re-size and move the scroll bars 
  5.                                             if the user has "grown" the  window */
  6. CWindowPtr    whichWindow;
  7. {
  8. ControlHandle    control;
  9.  
  10.     control = ((CWindowPeek)whichWindow)->controlList;
  11.     while(control)
  12.     {
  13.         if((*control)->contrlRfCon == HORIZONTAL_SCROLL)
  14.         {
  15.             MoveControl(control, (*control)->contrlOwner->portRect.left - ONE_PIXEL,
  16.                 (*control)->contrlOwner->portRect.bottom - BAR_WIDTH + ONE_PIXEL);
  17.             SizeControl(control, (*control)->contrlOwner->portRect.right - BAR_WIDTH + 2,
  18.                 BAR_WIDTH);
  19.         }
  20.         else if((*control)->contrlRfCon == VERTICLE_SCROLL)
  21.         {
  22.             MoveControl(control, (*control)->contrlOwner->portRect.right - BAR_WIDTH + ONE_PIXEL,
  23.                 (*control)->contrlOwner->portRect.top - ONE_PIXEL);
  24.             SizeControl(control, BAR_WIDTH,
  25.                 (*control)->contrlOwner->portRect.bottom - BAR_WIDTH + 2);
  26.         }
  27.         control = (*control)->nextControl;
  28.     }
  29. }
  30.